package com.winit.feature.repository;

import com.winit.feature.model.MFeature;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by wangjian on 2017/9/27.
 */
@Repository
public interface MFeatureRepository extends CrudRepository<MFeature,String> {

    @Query(value = "select * from matrix_feature where id = ?1 ", nativeQuery = true)
    MFeature findByFeatureId(String featureId);
    @Query(value = "select * from matrix_feature where id = ?1 ", nativeQuery = true)
    MFeature findById(String id);
    @Query(value = "select * from matrix_feature where id in (?1) ", nativeQuery = true)
    List<MFeature> findByFeatureIds(List<String> ids);
    @Query(value = "select * from matrix_feature where sys = ?1 ", nativeQuery = true)
    List<MFeature> findBySys(String sys);
    @Query(value = "select * from matrix_feature where original_page_id = ?1 ", nativeQuery = true)
    List<MFeature> findByPage(String page);
}
